package com.wswy.wzcx.model.resp;

import com.tencent.mm.opensdk.modelbase.BaseResp.ErrCode;

public class WXLoginResp {

  public WXLoginResp(int errCode, String code, String state) {
    this.errCode = errCode;
    this.code = code;
    this.state = state;
  }

  public int errCode;

  public String code;

  public String state;

  @Override
  public String toString() {
    return "WXLoginResp{" +
        "errCode=" + errCode +
        ", code='" + code + '\'' +
        ", state='" + state + '\'' +
        '}';
  }

  public String getErrorMsg(){
    switch (errCode){
      case ErrCode.ERR_OK:
        return null;
      case ErrCode.ERR_USER_CANCEL:
      return "取消微信登录";
      case ErrCode.ERR_AUTH_DENIED:
      return "授权取消";
      case ErrCode.ERR_UNSUPPORT:
        return "版本不支持";
      case ErrCode.ERR_BAN:
        return "ban";
        default:
          return "unknow";
    }
  }

}
